# -*- coding:utf-8 -*-
def _zhengshu():
    i = 1
    while True:
        yield i
        i += 1
def _filter_huishu(n):
    n = str(n)
    Len = int(len(n)/2)
    for j in range(1,Len+1):
        if n[j-1] != n[-j]:
            return 0
        if j == Len:
            return 1
zhengshu = _zhengshu()
f=_filter_huishu
huishu = filter(f,zhengshu)
for x in huishu:
    print(x)
    if x > 1000:
        break
